# coding=utf-8
# Copyright 2024 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Information about the COCO dataset."""

import frozendict

NUMBER_LABELS = 184

ID_TO_LABEL = frozendict.frozendict({
    0: 'unlabeled',
    1: 'person',
    2: 'bicycle',
    3: 'car',
    4: 'motorcycle',
    5: 'airplane',
    6: 'bus',
    7: 'train',
    8: 'truck',
    9: 'boat',
    10: 'traffic light',
    11: 'fire hydrant',
    12: 'street sign',
    13: 'stop sign',
    14: 'parking meter',
    15: 'bench',
    16: 'bird',
    17: 'cat',
    18: 'dog',
    19: 'horse',
    20: 'sheep',
    21: 'cow',
    22: 'elephant',
    23: 'bear',
    24: 'zebra',
    25: 'giraffe',
    26: 'hat',
    27: 'backpack',
    28: 'umbrella',
    29: 'shoe',
    30: 'eye glasses',
    31: 'handbag',
    32: 'tie',
    33: 'suitcase',
    34: 'frisbee',
    35: 'skis',
    36: 'snowboard',
    37: 'sports ball',
    38: 'kite',
    39: 'baseball bat',
    40: 'baseball glove',
    41: 'skateboard',
    42: 'surfboard',
    43: 'tennis racket',
    44: 'bottle',
    45: 'plate',
    46: 'wine glass',
    47: 'cup',
    48: 'fork',
    49: 'knife',
    50: 'spoon',
    51: 'bowl',
    52: 'banana',
    53: 'apple',
    54: 'sandwich',
    55: 'orange',
    56: 'broccoli',
    57: 'carrot',
    58: 'hot dog',
    59: 'pizza',
    60: 'donut',
    61: 'cake',
    62: 'chair',
    63: 'couch',
    64: 'potted plant',
    65: 'bed',
    66: 'mirror',
    67: 'dining table',
    68: 'window',
    69: 'desk',
    70: 'toilet',
    71: 'door',
    72: 'tv',
    73: 'laptop',
    74: 'mouse',
    75: 'remote',
    76: 'keyboard',
    77: 'cell phone',
    78: 'microwave',
    79: 'oven',
    80: 'toaster',
    81: 'sink',
    82: 'refrigerator',
    83: 'blender',
    84: 'book',
    85: 'clock',
    86: 'vase',
    87: 'scissors',
    88: 'teddy bear',
    89: 'hair drier',
    90: 'toothbrush',
    91: 'hair brush',
    92: 'banner',
    93: 'blanket',
    94: 'branch',
    95: 'bridge',
    96: 'building-other',
    97: 'bush',
    98: 'cabinet',
    99: 'cage',
    100: 'cardboard',
    101: 'carpet',
    102: 'ceiling-other',
    103: 'ceiling-tile',
    104: 'cloth',
    105: 'clothes',
    106: 'clouds',
    107: 'counter',
    108: 'cupboard',
    109: 'curtain',
    110: 'desk-stuff',
    111: 'dirt',
    112: 'door-stuff',
    113: 'fence',
    114: 'floor-marble',
    115: 'floor-other',
    116: 'floor-stone',
    117: 'floor-tile',
    118: 'floor-wood',
    119: 'flower',
    120: 'fog',
    121: 'food-other',
    122: 'fruit',
    123: 'furniture-other',
    124: 'grass',
    125: 'gravel',
    126: 'ground-other',
    127: 'hill',
    128: 'house',
    129: 'leaves',
    130: 'light',
    131: 'mat',
    132: 'metal',
    133: 'mirror-stuff',
    134: 'moss',
    135: 'mountain',
    136: 'mud',
    137: 'napkin',
    138: 'net',
    139: 'paper',
    140: 'pavement',
    141: 'pillow',
    142: 'plant-other',
    143: 'plastic',
    144: 'platform',
    145: 'playingfield',
    146: 'railing',
    147: 'railroad',
    148: 'river',
    149: 'road',
    150: 'rock',
    151: 'roof',
    152: 'rug',
    153: 'salad',
    154: 'sand',
    155: 'sea',
    156: 'shelf',
    157: 'sky-other',
    158: 'skyscraper',
    159: 'snow',
    160: 'solid-other',
    161: 'stairs',
    162: 'stone',
    163: 'straw',
    164: 'structural-other',
    165: 'table',
    166: 'tent',
    167: 'textile-other',
    168: 'towel',
    169: 'tree',
    170: 'vegetable',
    171: 'wall-brick',
    172: 'wall-concrete',
    173: 'wall-other',
    174: 'wall-panel',
    175: 'wall-stone',
    176: 'wall-tile',
    177: 'wall-wood',
    178: 'water-other',
    179: 'waterdrops',
    180: 'window-blind',
    181: 'window-other',
    182: 'wood',
    183: 'other',
})

LABEL_TO_ID = {v: k for k, v in ID_TO_LABEL.items()}

COLORS = {
    'unlabeled': (243, 244, 185),
    'person': (202, 56, 150),
    'bicycle': (170, 170, 227),
    'car': (157, 38, 194),
    'motorcycle': (100, 113, 86),
    'airplane': (140, 114, 65),
    'bus': (250, 60, 250),
    'train': (23, 25, 167),
    'truck': (148, 156, 62),
    'boat': (235, 241, 149),
    'traffic light': (160, 119, 245),
    'fire hydrant': (203, 97, 211),
    'street sign': (96, 79, 229),
    'stop sign': (244, 9, 154),
    'parking meter': (182, 240, 172),
    'bench': (223, 253, 191),
    'bird': (134, 69, 29),
    'cat': (49, 57, 130),
    'dog': (178, 140, 1),
    'horse': (193, 160, 5),
    'sheep': (66, 247, 104),
    'cow': (18, 252, 204),
    'elephant': (137, 166, 130),
    'bear': (190, 235, 122),
    'zebra': (119, 188, 52),
    'giraffe': (254, 162, 183),
    'hat': (37, 143, 31),
    'backpack': (188, 58, 140),
    'umbrella': (38, 193, 127),
    'shoe': (244, 242, 147),
    'eye glasses': (75, 66, 215),
    'handbag': (243, 60, 174),
    'tie': (35, 90, 162),
    'suitcase': (56, 48, 235),
    'frisbee': (109, 1, 214),
    'skis': (87, 252, 31),
    'snowboard': (222, 43, 26),
    'sports ball': (208, 31, 240),
    'kite': (136, 156, 118),
    'baseball bat': (34, 49, 84),
    'baseball glove': (186, 193, 135),
    'skateboard': (179, 112, 185),
    'surfboard': (221, 26, 65),
    'tennis racket': (192, 219, 249),
    'bottle': (159, 31, 127),
    'plate': (89, 70, 248),
    'wine glass': (157, 102, 166),
    'cup': (224, 106, 35),
    'fork': (62, 151, 239),
    'knife': (96, 246, 47),
    'spoon': (140, 145, 15),
    'bowl': (13, 154, 133),
    'banana': (103, 168, 22),
    'apple': (91, 56, 211),
    'sandwich': (163, 2, 38),
    'orange': (147, 135, 140),
    'broccoli': (107, 136, 132),
    'carrot': (253, 145, 219),
    'hot dog': (215, 172, 53),
    'pizza': (180, 26, 9),
    'donut': (149, 182, 140),
    'cake': (178, 89, 61),
    'chair': (91, 160, 30),
    'couch': (179, 165, 25),
    'potted plant': (55, 162, 206),
    'bed': (198, 73, 71),
    'mirror': (34, 217, 173),
    'dining table': (155, 46, 74),
    'window': (226, 156, 103),
    'desk': (73, 213, 199),
    'toilet': (38, 65, 190),
    'door': (147, 227, 227),
    'tv': (57, 242, 133),
    'laptop': (227, 118, 228),
    'mouse': (179, 248, 148),
    'remote': (1, 187, 54),
    'keyboard': (39, 21, 8),
    'cell phone': (143, 75, 251),
    'microwave': (116, 121, 180),
    'oven': (175, 83, 83),
    'toaster': (132, 26, 58),
    'sink': (75, 75, 187),
    'refrigerator': (254, 93, 45),
    'blender': (25, 57, 113),
    'book': (245, 235, 18),
    'clock': (55, 198, 35),
    'vase': (110, 68, 94),
    'scissors': (0, 141, 199),
    'teddy bear': (195, 63, 24),
    'hair drier': (143, 2, 215),
    'toothbrush': (170, 178, 87),
    'hair brush': (210, 37, 17),
    'banner': (1, 44, 18),
    'blanket': (100, 6, 120),
    'branch': (224, 164, 50),
    'bridge': (141, 9, 42),
    'building-other': (127, 118, 196),
    'bush': (236, 220, 174),
    'cabinet': (239, 198, 194),
    'cage': (7, 82, 168),
    'cardboard': (161, 111, 178),
    'carpet': (215, 58, 71),
    'ceiling-other': (233, 142, 124),
    'ceiling-tile': (18, 126, 254),
    'cloth': (65, 44, 137),
    'clothes': (179, 83, 221),
    'clouds': (81, 107, 254),
    'counter': (82, 194, 8),
    'cupboard': (229, 155, 59),
    'curtain': (152, 193, 192),
    'desk-stuff': (70, 193, 254),
    'dirt': (114, 60, 153),
    'door-stuff': (190, 154, 250),
    'fence': (43, 69, 208),
    'floor-marble': (227, 8, 123),
    'floor-other': (215, 0, 171),
    'floor-stone': (28, 72, 201),
    'floor-tile': (115, 6, 94),
    'floor-wood': (173, 189, 63),
    'flower': (163, 228, 127),
    'fog': (68, 91, 132),
    'food-other': (74, 82, 67),
    'fruit': (84, 206, 138),
    'furniture-other': (231, 31, 29),
    'grass': (99, 42, 252),
    'gravel': (28, 74, 139),
    'ground-other': (229, 83, 197),
    'hill': (243, 18, 208),
    'house': (126, 160, 64),
    'leaves': (38, 141, 164),
    'light': (113, 207, 129),
    'mat': (210, 196, 181),
    'metal': (101, 109, 90),
    'mirror-stuff': (240, 97, 113),
    'moss': (109, 148, 202),
    'mountain': (197, 45, 134),
    'mud': (232, 13, 133),
    'napkin': (235, 47, 1),
    'net': (139, 35, 120),
    'paper': (140, 98, 245),
    'pavement': (125, 151, 2),
    'pillow': (164, 234, 161),
    'plant-other': (64, 243, 187),
    'plastic': (98, 196, 187),
    'platform': (24, 44, 102),
    'playingfield': (193, 106, 51),
    'railing': (245, 199, 217),
    'railroad': (122, 94, 142),
    'river': (163, 255, 118),
    'road': (68, 125, 77),
    'rock': (135, 178, 145),
    'roof': (1, 158, 116),
    'rug': (108, 82, 71),
    'salad': (94, 165, 138),
    'sand': (50, 147, 208),
    'sea': (233, 97, 22),
    'shelf': (232, 41, 111),
    'sky-other': (79, 154, 125),
    'skyscraper': (150, 61, 135),
    'snow': (142, 158, 225),
    'solid-other': (188, 220, 178),
    'stairs': (110, 29, 149),
    'stone': (179, 89, 131),
    'straw': (14, 79, 24),
    'structural-other': (73, 154, 41),
    'table': (52, 238, 22),
    'tent': (192, 179, 145),
    'textile-other': (227, 231, 117),
    'towel': (19, 77, 61),
    'tree': (106, 4, 56),
    'vegetable': (66, 183, 157),
    'wall-brick': (211, 85, 212),
    'wall-concrete': (3, 226, 158),
    'wall-other': (190, 105, 215),
    'wall-panel': (62, 69, 179),
    'wall-stone': (146, 209, 0),
    'wall-tile': (107, 89, 85),
    'wall-wood': (143, 9, 143),
    'water-other': (197, 251, 85),
    'waterdrops': (56, 207, 41),
    'window-blind': (162, 156, 29),
    'window-other': (36, 184, 149),
    'wood': (29, 35, 232),
    'other': (255, 255, 255),
}


FRAME_WIDTH, FRAME_HEIGHT = 640, 480
